- /* slftctbl.cpp by K.Tsuru */
- // function ID 4105 DRADIX
- /**********************************************
- SLong class
- It makes a table of tangent coefficients T[n]
- using the arithmetic of SInteger class.
- T[0] = 0, T[n] = Tn (n>0)
- **********************************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
-
- void TanCoeffTable(SNBlock <SLong>& T, uint N){
- SNBlock <SInteger> t(2*N+1);
- T.reserve(N);
-
- int err = (t.Error() != t.NORMAL) || (T.Error() != T.NORMAL);
- if(err) t[0].SetError(t[0].OUT_OF_RANGE,"TanCoeffTable", 7101);
- uint i, n;
-
- T[0].SetZero();
- for(i = 0; i <= 2*N; i++) t[i].SetZero();
- t[1].SetLong(1);
- for(n = 2; n <= 2*N; n++){
- for(i = 1; i< n; i++) IsMult(t[i], i, t[i-1]);
- t[n-1].SetZero();
- for(i = n; i >= 2; i--) IIAdd(t[i], t[i-2], t[i]);
- if(n % 2 == 0) T[n/2] = t[0].ConvToDec(); // radix conversion
- }
- }
slftctbl.cpp : last modifiled at 2015/11/27 14:08:19(884 bytes)
created at 2017/10/07 10:26:50
The creation time of this html file is 2017/11/09 14:52:03 (Thu Nov 09 14:52:03 2017).